package transport;

import java.util.ArrayList;




public class TransportRoutingTable {

	ArrayList<TransportConnection> table;

	public TransportRoutingTable() {
		table = new ArrayList<TransportConnection>();
	}

	public void add(TransportConnection conn) {
		if (!table.contains(conn)) {
			table.add(conn);
		} else {
			throw new IllegalArgumentException("Connection is already in use.");
		}
	}

	public TransportConnection get(int outport) {
		return table.get(outport);
	}
	
	public ArrayList<TransportConnection> getTable(){
		return table;
	}

}
